download file from gere


In [2]:
import netCDF4
from matplotlib import pyplot as plt
%matplotlib inline

In [3]:
my_filename = '/data/radar/pvc/wsacr/pvcwsacrhsrhiM1.b1.20121105.201200.nc'

In [4]:
my_dataset = netCDF4.Dataset(my_filename)

In [6]:
print(my_dataset.variables.keys())


[u'base_time', u'time_offset', u'time', u'qc_time', u'range', u'azimuth', u'elevation', u'scan_rate', u'antenna_transition', u'reflectivity', u'mean_doppler_velocity', u'spectral_width', u'snr', u'linear_depolarization_ratio', u'pulse_width', u'nyquist_velocity', u'unambiguous_range', u'n_samples', u'volume_number', u'frequency', u'sweep_number', u'prt', u'fixed_angle', u'sweep_start_ray_index', u'sweep_end_ray_index', u'follow_mode', u'sweep_mode', u'prt_mode', u'polarization_mode', u'radar_antenna_gain_h', u'radar_antenna_gain_v', u'radar_beam_width_h', u'radar_beam_width_v', u'radar_measured_transmit_power_h', u'platform_type', u'instrument_type', u'primary_axis', u'time_coverage_start', u'time_coverage_end', u'r_calib_index', u'r_calib_time', u'r_calib_pulse_width', u'r_calib_two_way_radome_loss_h', u'r_calib_xmit_power_h', u'r_calib_receiver_gain_hc', u'r_calib_receiver_gain_vx', u'r_calib_noise_hc', u'r_calib_noise_vx', u'r_calib_noise_source_power_h', u'r_calib_noise_source_power_v', u'r_calib_radar_constant_h', u'r_calib_radar_constant_v', u'latitude', u'longitude', u'altitude', u'altitude_agl', u'lat', u'lon', u'alt']

In [8]:
print(my_dataset.variables['elevation'].ncattrs())


[u'long_name', u'units', u'standard_name', u'axis']

In [11]:
print(my_dataset.variables['elevation'].standard_name)


beam_elevation_angle

In [12]:
print(my_dataset.variables['elevation'][:])


[ 0.39692608  0.39692608  0.39692608 ...,  0.40241933  0.40241933
  0.40241933]

In [13]:
print(my_dataset.variables['elevation'][:].shape)


(4037,)

In [25]:
my_figure = plt.figure(figsize=[10,5])
plt.plot(my_dataset.variables['time'][10:110], my_dataset.variables['elevation'][10:110])
plt.xlabel(my_dataset.variables['time'].standard_name)


Out[25]:
<matplotlib.text.Text at 0x109a4b610>

In [23]:
my_figure = plt.figure(figsize=[10,5])
plt.pcolormesh(my_dataset.variables['reflectivity'][:].transpose())
plt.xlabel(my_dataset.variables['time'].standard_name)


Out[23]:
<matplotlib.text.Text at 0x109a80410>

In [ ]: